package com.cloudfast.platform.role.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.cloudfast.entity.BaseEntity;
import com.cloudfast.repository.annotation.DeleteField;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author liuyw
 * @描述:
 * @date 2020年4月30日
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "sys_role")
@Getter
@Setter
public class Role extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ApiModelProperty(value = "角色名称", required = true)
    private String name;

    @ApiModelProperty(value = "角色编码", required = true)
    private String code;

    /**
     * 是否不可见;顶级管理员
     **/
    @ApiModelProperty(value = "是否是顶级角色")
    private String isAdmin;

    @DeleteField
    @ApiModelProperty(value = "删除字体:默认0")
    private String delFlag = "0";

    @Transient
    private String menus;

    public Role(String name, String code, String isAdmin) {
        this.name = name;
        this.code = code;
        this.isAdmin = isAdmin;
    }

    public Role(Long id, String name, String code, String isAdmin) {
        this.name = name;
        this.code = code;
        this.isAdmin = isAdmin;
        this.id = id;
    }

    public Role() {

    }

    public Role(Long id) {
        this.id = id;
    }

}
